package com.atguigu.dga.score.service.impl;

import com.atguigu.dga.assess.service.GovernanceAssessDetailService;
import com.atguigu.dga.score.service.GovernanceAssessGlobalService;
import com.atguigu.dga.score.service.GovernanceAssessTableService;
import com.atguigu.dga.score.service.GovernanceAssessTecOwnerService;
import org.springframework.beans.factory.annotation.Autowired;

public class CalScoreService implements com.atguigu.dga.score.service.CalScoreService {
    @Autowired
    private GovernanceAssessDetailService detailService;

    @Autowired
    private GovernanceAssessTableService tableService;
    @Autowired
    private GovernanceAssessTecOwnerService ownerService;
    @Autowired
    private GovernanceAssessGlobalService globalService;
    /*
        算分的总流程
     */
    @Override
    public void calScore(String assessDate) throws Exception {

        //生成考评明细
        detailService.assess(assessDate);

        //先算每张表的得分
        tableService.saveTableScore(assessDate);

        //再算每个人的得分
        ownerService.saveTecOwnerScore(assessDate);

        //再算总得分
        globalService.saveGlobalScore(assessDate);

    }
}
